package com.chen.domain;

import com.chen.annotation.Excel;
import com.chen.core.domain.BaseEntity;
import com.chen.service.valid.ValidAll;
import com.chen.service.valid.ValidEdit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 产品对象 document
 *
 * @author chenyj
 * @date 2023-07-19
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("文档对象实体")
public class Document extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @NotNull(groups = {ValidEdit.class}, message = "文档主键不可为空")
    @ApiModelProperty(value = "文档主键")
    private Long documentId;

    /**
     * 文档名称
     */
    @NotBlank(groups = {ValidAll.class}, message = "文档名称不可为空")
    @ApiModelProperty(value = "文档名称")
    @Excel(name = "文档名称")
    private String documentName;

    /**
     * 安全等级
     */
    @ApiModelProperty(value = "安全等级", example = "1")
    @Excel(name = "安全等级")
    private Integer safeLevel = 1;

    /**
     * 存储路径
     */
    @ApiModelProperty(value = "存储路径")
    @Excel(name = "存储路径")
    private String documentPath;

    /**
     * 父节点id
     */
    @ApiModelProperty(value = "父节点id")
    private Long parentId;

    /**
     * 代码
     */
    @ApiModelProperty(value = "对应产品那边的code,方便查询目录下的所有文档")
    private String code;

    /**
     * productId
     */
    @ApiModelProperty(value = "productId")
    private Long productId;

    /**
     * 文档类型（后续是否加上安装包和tool）
     */
    @ApiModelProperty(value = "文档类型（file package tool）")
    @Excel(name = "文档类型")
    private String type;

    private Long rootId;

    @NotNull(groups = {ValidAll.class})
    @Size(groups = {ValidAll.class}, min = 1, max = 3, message = "ids为1-3")
    private List<Long> ids;

    @Valid
    @NotNull
    private SysNotice sysNotice;

}